<template>
		<view class="brand acea-row" v-if="brandData.length">
			<block v-for="(item,index) in brandData" :key='index'>
					<view class="item"  @click="toSearch(item.name)">
						<view class="logo">
							<image :src="item.logo"></image>
						</view>
						<view class="name">{{item.name}}</view>
					</view>
			</block>
			<view class="item">
				<navigator :url='more.link' hover-class="none">
					<view class="logo">
						<image :src="more.logo"></image>
					</view>
					<view class="name">{{more.name}}</view>
				</navigator>
			</view>
		</view>
</template>

<script>
		export default {
			name: 'Brand',
			props: {
			},
			data() {
				return {
					brandData:[], 
					more:""
				};
			},
			created() {
				var that = this;
				//获取品牌
				uni.request({
					 url: 'https://d.qj361.com/api/yizhan/band', //仅为示例，并非真实接口地址。
					    data: {},
					    header: {},
					    success: (res) => {
							console.log('品牌');
							console.log(res.data);
							var band = res.data.band;
							var more = res.data.more;
							that.brandData = band;
							that.more = more
					    }
				});
			},
			mounted() {},
			methods: {
				toSearch(s) {
					console.log("s"+s);
					this.$yrouter.push({
						path: "/pages/shop/GoodsList/index",
						query: {
							s
						}
					});
				},
			}
		}
</script>

<style lang="scss">
	.brand{
		display: flex!important;
		width:100%;
		height:172rpx;
		// padding:0 26rpx 0 26rpx;
		justify-items: center;
		justify-content:space-between;
		.item{
			width: 110rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			.logo{
				width:110rpx;
				height:80rpx;
				margin:0 auto;
				image{
					width:100%;
					height:100%;
				}
			}
			.name{
				margin-top:16rpx;
				font-size: 22rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #333333;
				line-height: 30rpx;
				text-align:center;
			}
		}
	}
</style>
